Only compile activated optional dependencies
authorAlex Crichton <alex@alexcrichton.com>
Fri, 17 Jul 2015 17:05:57 +0000 (10:05 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 17 Jul 2015 17:05:57 +0000 (10:05 -0700)
commit70152d800313e0db1c4112e0debed960e058335e
treecd6bf0cba71f97b624ec03b29634397ae2a77e99
parent25644b7f51cedd669e7ac864746b78268be8d84d
Only compile activated optional dependencies

Development dependencies are traversed during the resolution process, causing
them to be returned as the list of dependencies for a package in terms of
resolution. The compilation phase would then filter these out depending on the
dependency's transitivity, but this was incorrectly accounted for when the
dependency showed up multiple times in a few lists.

This commit fixes this behavior by updating the filtering logic to ensure that
only activated optional dependencies (those whose feature names are listed) are
compiled.

Closes #1805
src/cargo/ops/cargo_rustc/context.rs
tests/test_cargo_features.rs